#include <iostream>
#include <math.h>

double f(double x, double y)
{
	return x + cos(y / sqrt(2.0));
}

double rkstep(double x, double y, double h)
{
	double k1 = h*f(x,y);
	double k2 = h*f(x + h / 2.0, y + k1 / 2.0);
	double k3 = h*f(x + h / 2.0, y + k2 / 2.0);
	double k4 = h*f(x+h, y+k3);

	return y + (k1 + 2.0*k2 + 2.0*k2 + k4) / 6.0;
}

int main(int argc, char argv[])
{
	double h = 0.1;
	double a = 0.8;
	double b = 1.8;
	int n = (b-a) / h;

	double x = 0.8;
	double y = 1.4;

	std::cout << "x = " << x << "     y = " << y << "\n";

	for(int i=0; i<n; i++)
	{
		y = rkstep(x, y, h);
		x += h;
		std::cout << "x = " << x << "     y = " << y << "\n";
	}

	int vtr;
	std::cin >> vtr;

	return 0;
}